al=$1
what=$2
global=$3

alias_path="$ZSH_CUSTOM/local-aliases.zsh"

if [[ "-g" == $al ]]; then
    al=$what
    what=$global
    global="-g"
fi

if [[ $global == "-g" ]]; then
    alias_path="$ZSH_CUSTOM/aliases.zsh"
fi

echo "alias $al='$what'" >> $alias_path
